﻿namespace HiMap.MapControls.Tools
{
    using HiMap.MapControls;
    using System;
    using System.Windows.Forms;

    public abstract class CommandClass : ICommand
    {
        protected internal Control _RunCommandControl;
        protected internal MapControl Map;

        protected CommandClass()
        {
        }

        void ICommand.OnClick()
        {
            this.OnClick();
        }

        void ICommand.OnCreate(MapControl Map)
        {
            this.OnCommandCreate(Map);
        }

        protected internal virtual void OnClick()
        {
        }

        protected virtual void OnCommandCreate(MapControl Map)
        {
            this.Map = Map;
        }

        Control ICommand.RunCommandControl
        {
            get
            {
                return this._RunCommandControl;
            }
            set
            {
                this._RunCommandControl = value;
            }
        }
    }
}

